import InterfaceProxy from 'src/utils/mider'
import { defaultOptions } from './_options'

/**
 * 工具服务接口
 * @namespace iUtil
 */

/** @lends iInfo# */
const interfaceOpt = {
  getSiteInfo: {
    url: '/p/v1/tool-api/tool/actions/getSiteInfo',
    method: 'post',
    params: {
      query: {
        url: String
      }
    }
  },
  rsshub: {
    url: '/p/v1/info-api/rsshub',
    method: 'post',
    data: {
      rsshubUrl: String
    }
  }
}

/** @mixes iUtil */
const iUtil = new InterfaceProxy(interfaceOpt, [defaultOptions, {
  baseURL: process.env.utilApi
}])

export default iUtil
